home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / CreationFX.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  3.3 KB  |  105 lines

  1. class classes.fx.CreationFX
  2. {
  3.    var x;
  4.    var y;
  5.    var i;
  6.    var id;
  7.    var waveMax;
  8.    var moveScript;
  9.    var matrixCoords;
  10.    var fxType;
  11.    var enemyType;
  12.    var clip;
  13.    var formID;
  14.    var c = 0;
  15.    var c2 = 0;
  16.    var waveC = 0;
  17.    var endSeq = false;
  18.    var Name = "creationFX";
  19.    function CreationFX(pi, px, py, pfxType, penemyType, pwaveMax, pmoveScript, pmatrixCoords, pid)
  20.    {
  21.       this.x = px;
  22.       this.y = py;
  23.       this.i = pi;
  24.       this.id = pid;
  25.       this.waveMax = pwaveMax;
  26.       this.moveScript = pmoveScript;
  27.       this.matrixCoords = pmatrixCoords;
  28.       this.fxType = pfxType;
  29.       this.enemyType = penemyType;
  30.       _root.d = _root.d + 1;
  31.       this.clip = _root.attachMovie("creationFX" + this.fxType,"creationFX" + this.id + "Clip",_root.d + 200000);
  32.       this.clip._x = this.x;
  33.       this.clip._y = this.y;
  34.       _root.formID = _root.formID + 1;
  35.       this.formID = _root.formID;
  36.       _root["form" + _root.formID] = [];
  37.       if(this.fxType == "1D")
  38.       {
  39.          this.waveMax = 5;
  40.          this.waveC = 4;
  41.       }
  42.       if(this.fxType == "2A" || this.fxType == "2B" || this.fxType == "2C")
  43.       {
  44.          this.waveMax = 3;
  45.          this.waveC = 2;
  46.       }
  47.       if(this.fxType == "1D")
  48.       {
  49.          _root.audio.playLevel2("headBossIntro",30);
  50.       }
  51.       else
  52.       {
  53.          var _loc3_ = this.fxType.charAt(1);
  54.          _root.audio.playLevel2("head" + _loc3_ + "Intro",30);
  55.       }
  56.    }
  57.    function main()
  58.    {
  59.       if(this.clip.create)
  60.       {
  61.          this.c = this.c + 1;
  62.          this.c2 = this.c2 + 1;
  63.          if(this.c == this.i)
  64.          {
  65.             this.c = 0;
  66.             var _loc5_ = [this.formID,this.waveC + 1];
  67.             _root["create" + this.enemyType]([this.x - 10,this.y - 10,this.moveScript,this.matrixCoords[this.waveC],_loc5_]);
  68.             _root.flashing = true;
  69.             this.waveC = this.waveC + 1;
  70.             if(this.waveC == this.waveMax)
  71.             {
  72.                this.endSeq = true;
  73.                this.clip.create = false;
  74.                if(this.fxType == "1D")
  75.                {
  76.                   var _loc3_ = 0;
  77.                   var _loc4_ = _root.randRange(30,45);
  78.                   while(_loc3_ < _loc4_)
  79.                   {
  80.                      _root.fxID = _root.fxID + 1;
  81.                      _root["rampageTrailB" + _root.fxID] = new classes.fx.RampageTrailB(this.x,this.y,_root.fxID);
  82.                      _root.addFX("rampageTrailB" + _root.fxID);
  83.                      _loc3_ = _loc3_ + 1;
  84.                   }
  85.                }
  86.             }
  87.          }
  88.          this.clip._alpha = 100 - this.c2 * (100 / (this.i * this.waveMax)) / 2;
  89.          this.clip._xscale = 100 - this.c2 * (100 / (this.i * this.waveMax)) / 2;
  90.          this.clip._yscale = 100 - this.c2 * (100 / (this.i * this.waveMax)) / 2;
  91.       }
  92.       if(this.endSeq)
  93.       {
  94.          this.c2 = this.c2 + 1;
  95.          this.clip._alpha = 100 - this.c2 * (100 / (this.i * this.waveMax)) / 2;
  96.          this.clip._xscale = 100 - this.c2 * (100 / (this.i * this.waveMax)) / 2;
  97.          this.clip._yscale = 100 - this.c2 * (100 / (this.i * this.waveMax)) / 2;
  98.          if(this.clip._alpha < 2)
  99.          {
  100.             _root.removeFX("creationFX" + this.id);
  101.          }
  102.       }
  103.    }
  104. }
  105.